Contract Functions
Referral Storageβ
registerCodeβ
Public function for setting the user's referral code.
function registerCode(string memory _code)
configureβ
Admin function to set the config for step reduction and discount on the basis of tier
function configure(
uint8[3] calldata _referrerTierStep,
uint32[3] calldata _referrerTierDiscount // Factor of 1e5
)
setReferrerTierβ
Admin function to set referrer's tier
function setReferrerTier(address _referrer, uint8 tier)
Option Routerβ
revokeApprovalsβ
function revokeApprovals(RevokeParams[] memory revokeParams)
openTradesβ
Function for keepers to open the queued trades
function openTrades(OpenTxn[] calldata params)
executeOptionsβ
Function for keepers to close the expired trades
function executeOptions(CloseTradeParams[] calldata optionData)
closeAnytimeβ
Function for keepers to close when requested by user
function closeAnytime(CloseAnytimeParams[] memory closeParams) external
setContractRegistryβ
Admin function to set/unset the asset pairs for trading
function setContractRegistry(address targetContract, bool register)
setKeeperβ
Admin function to set/unset keepers
function setKeeper(address _keeper, bool _isActive)
Liquidity Poolβ
setHandlerβ
Admin function to set handlers
function setHandler(address _handler, bool _isActive)
setMaxLiquidityβ
Admin function to set max liquidity
function setMaxLiquidity(uint256 _maxLiquidity)
Provideβ
Public function to add liquidity
function provide(uint256 tokenXAmount, uint256 minMint)
provideForAccountβ
Handler only function to add liquidity for an account
function provideForAccount(
uint256 tokenXAmount,
uint256 minMint,
address account
)
Withdrawβ
Public function to remove liquidity
function withdraw(uint256 tokenXAmount)
withdrawForAccountβ
Handler only function to remove liquidity for an account
function withdrawForAccount(uint256 tokenXAmount, address account)
toTokenXβ
Returns tokenX equivalent of a certain amount BLP
function toTokenX(uint256 amount)
getUnlockedLiquidityβ
Returns available liquidity
function getUnlockedLiquidity(address account)
shareOfβ
Returns provider's share in tokenX
function shareOf(address account)
availableBalanceβ
Returns the amount of tokenX available for withdrawals
function availableBalance()
totalTokenXBalanceβ
Returns the total balance of tokenX provided to the pool
function totalTokenXBalance()
Buffer Optionsβ
setIsPausedβ
Admin only function to pause/Unpause the option creation
function setIsPaused()
feesβ
Returns the fees for buying an option
function fees(
uint256 amount,
address user,
string calldata referralCode,
uint256 baseSettlementFeePercentage
)
isStrikeValidβ
Returns true if the strike price at which the trade is opened lies within the slippage bounds
function isStrikeValid(
uint256 slippage,
uint256 strike,
uint256 expectedStrike
)
getMaxTradeSizeβ
function getMaxTradeSize() public view returns (uint256)
getMaxOIβ
function getMaxOI() public view returns (uint256)
getSettlementFeePercentageβ
function getSettlementFeePercentage(
address referrer,
address user,
uint256 baseSettlementFeePercentage
) public view returns (uint256 settlementFeePercentage)